#set($title = "富士通南大外勤管理系统")
#set( $path =$request.getContextPath())
#set( $basePath = $request.getScheme() + "://"+ $request.getServerName() + ":" + $request.getServerPort()+ $path + "/")
<style type="text/css">
    body, html, #allmap {
        width: 100%;
        height: 100%;
        overflow: hidden;
        margin: 0;
    }
    
    #l-map {
        height: 100%;
        width: 78%;
        float: left;
        border-right: 2px solid #bcbcbc;
    }
    
    #r-result {
        height: 100%;
        width: 20%;
        float: left;
    }
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=9206ae8c062309ca5c85854884318160">
</script>
<div id="allmap">
</div>
<script type="text/javascript">
    var map = new BMap.Map("allmap");
    map.enableScrollWheelZoom(true);
    var point = new BMap.Point($company.latitude, $company.longitude);//公司地点
    map.centerAndZoom(point, 15);
    var marker = new BMap.Marker(point); // 创建标注
    map.addOverlay(marker); // 将标注添加到地图中
    var label = new BMap.Label("$company.companyName", {
        offset: new BMap.Size(20, -10)
    });
    var cr = new BMap.CopyrightControl({
        anchor: BMAP_ANCHOR_BOTTOM_RIGHT
    });
    map.addControl(new BMap.MapTypeControl({
        anchor: BMAP_ANCHOR_TOP_RIGHT
    })); //右上角，默认地图控件
    map.addControl(cr); //添加版权控件
    var bs = map.getBounds();
    cr.addCopyright({
        id: 1,
        content: "<a target='_balnk' href='http://cn.fujitsu.com' style='font-size:20px;background:blue'>©$date.format('yyyy',$date)Fujitsu</a>",
        bounds: bs
    });
    map.addControl(new BMap.NavigationControl()); //添加默认缩放平移控件
    marker.setLabel(label);
    var sContent = "<h4 style='margin:0 0 5px 0;padding:0.2em 0'>$company.companyName</h4>" +
    "<table><tr><td>registered</td><td> $date.format('yyyy-MM-dd',$company.createDatetime)</td>" +
    "</tr><tr><td>size</td><td>$domain.companySize($company.companySize)</td></tr><tr><td>state</td>" +
    "<td>$domain.companyState($company.companyState)</td></tr><tr><td>address</td><td>$!company.address</td>" +
    "</tr><tr><td>remark</td><td>$!company.remark</td></tr></table></div>";
    var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
    map.addOverlay(marker);
    marker.addEventListener("click", function(){
        this.openInfoWindow(infoWindow);
    });
</script>
